<?php
session_start();
include "configs/dbconnect.php";
$username = $_POST['txtusername'];
$pass = $_POST['txtpassword'];
$sql = "SELECT MA_DON_VI FROM TAI_KHOAN
        WHERE TEN_TK='$username'
	AND MAT_KHAU='$pass'";
$rs = mysql_query($sql);
if ($rw = mysql_fetch_array($rs)) {
    $_SESSION['userinfo']['MA_DON_VI'] = $rw['MA_DON_VI'];
} else {
    echo "<script> alert('Ten dang nhap hoac mat khau khong dung');</script>";
}
?>
<script>location.href = 'index.php';</script>
